﻿#pragma once
#include <signal.h>
#include "receiver.h"
#include <param.hpp>

class tick_signal : public lt::signal, public lt::tick_receiver
{

public:
	
	tick_signal(lt::sigid_t id, lt::engine& engine,const lt::param& p):
		signal(id,engine),
		_code(p.get<code_t>("code"))
		{
		};


	~tick_signal(){};


public:

	/*
	*	初始化事件
	*	生命周期中只会回调一次
	*/
	virtual void on_init(lt::subscriber& suber) override;

	/*
	 *	销毁
	 */
	virtual void on_destory(lt::unsubscriber& unsuber) override;
	/*
	 *	tick推送
	 */
	virtual void on_tick(const tick_info& tick, const deal_info& deal)  override;

private:
	
	code_t _code ;

};

